package service.reader.impl;

import dao.reader.BooksDao;
import dao.reader.impl.BooksImpl;
import entity.Books;
import entity.Pages;

import java.util.List;

/**
 * BooksServletImpl
 *
 * @author lenovo
 * @since 2023/8/30
 */
public class BooksService implements service.reader.BooksService {

    BooksDao dao = new BooksImpl();

    @Override
    public List<Books> getList(String condition, String conditionValue, Pages<Books> pages) {
        int pageSize = pages.getPageSize();
        int pageIndex = (pages.getPageCountNo() - 1) * pageSize;
        return dao.getList(condition,conditionValue,pageIndex,pageSize);
    }

    @Override
    public int pageCount(String condition, String conditionValue) {
        return dao.pageCount(condition,conditionValue);
    }
}
